package lambda;

import java.util.function.Consumer;

/**
 * @author LiuYan
 * @date 2021/11/17 8:46
 */
public class Part01 {

    public static void main(String[] args) {
        // 匿名内部类
        MyInterface myInterface = new MyInterface() {
            @Override
            public void watchFilm() {
                System.out.println("匿名内部类一起撸代码");
            }
        };
        myInterface.watchFilm();
        // lambda表达式
        MyInterface myInterface1 = () -> System.out.println("lambda表达式一起撸代码");
        myInterface1.watchFilm();

        Consumer<String> consumer = x -> System.out.println(x);
        consumer.accept("consumer 撸代码");



    }
}
